﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NF.Core.Fuzzy
{
    public class Rule
    {
        public Rule(params IFuzzySet[] premises)
        {
            mPremises = premises;

            StringBuilder sb = new StringBuilder();
            foreach (var p in mPremises)
                sb.Append(p.Label);

            Signature = sb.ToString();
        }

        public IFuzzySet this[int index]
        {
            get { return mPremises[index]; }
        }

        public int Order
        {
            get
            {
                if (mPremises == null)
                    return 0;
                return mPremises.Length;
            }
        }

        public String Signature
        {
            get;
            private set;
        }

        public IFuzzySet Conclusion
        {
            get;
            set;
        }

        private IFuzzySet[] mPremises;
    }
}
